<?php
/**
 * Created by PhpStorm.
 * User: cape
 * Date: 2017/11/14
 * Time: 9:08
 */


header('content-type:text/html;charset=utf-8');


$funName = 'md5';
echo $funName('king');
echo '<br/>';
echo md5('king');
echo '<hr/>';


function foo()
{
    echo 'In foo()<br/>\n';
}

function bar($arg = '')
{
    echo "In bar(); argument was '$arg'.<br/>\n";
}


function echoit($string)
{
    echo $string;
}

$func = 'foo';
$func();
echo '<hr/>';
bar(34);

class Foo
{
    function Variable(){
        $name = 'Bar';
        $this ->$name();
    }

    function Bar(){
        echo 'This is Bar';
    }
}


$foo = new Foo();
$funcname = "Variable";
$foo->$funcname();


class Foo2
{
    static $variable = 'static property';
    static function Variable(){
        echo 'Method Variable called';
    }
}

echo '<hr/>';

echo Foo2::$variable;
echo '<hr/>';
$variable='Variable';
Foo2::$variable();


var_dump(get_defined_functions());






















